{include file='../public_btn.html'}
<div class="html-box">
    <form class="cond-form clear" action="#!member/message" onsubmit="return xForm.submit(this)">
        <input type="hidden" value="" name="page" id="page">
        <div class="f-unit">
            <select name="k" id="k">
                <option value="content" {if $smarty.get.k eq 'content'}selected{/if}>留言内容</option>
            </select>
            <input id="q" class="form-i w160 sitem" name="q" value="{$smarty.get.q}" type="text">
            <label class="ui-label">发送者（系统 <input type="checkbox" name="sys" value="1" {if $smarty.get.sys eq 1}checked{/if} />）：</label>
            <input id="username" class="form-i w160 sitem" name="username" value="{$smarty.get.username}" type="text">
            <label class="ui-label">接收者（系统 <input type="checkbox" name="to_sys" value="1" {if $smarty.get.to_sys eq 1}checked{/if} />）：</label>
            <input id="to_username" class="form-i w160 sitem" name="to_username" value="{$smarty.get.to_username}" type="text">
            <button type="submit" style="margin-left:10px; margin-top:1px" class="uiBtn BtnBlue">搜索</button>
        </div>
    </form>

    <table class="list" style="width:100%">
        <thead>
        <tr>
            <th class="w40">ID</th>
            <th class="title">留言内容</th>
            <th class="w80">发送者</th>
            <th class="w80">接收者</th>
            <th class="w300">发送时间</th>
            <th class="w80">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach from=$list item=m}
        <tr class="opera">
            <td>{$m.id}</td>
            <td class="title">
                <div>{$m.content}</div>
                {if $m.reply}
                [回复]{$m.reply.content}({date('Y-m-d H:i:s',$m.reply.add_time)})(<span class="c-orange">{$m.id}</span>)
                {/if}
            </td>
            <td>{if $m.mid}{$m.username}{else}<span class="c-orange">系统</span>{/if}</td>
            <td>{if $m.to_mid}{$m.to_username}{else}<span class="c-orange">系统</span>{/if}</td>
            <td>{date('Y-m-d H:i',$m.add_time)}</td>
            <td>
                {if !$m.reply}<a href="#!member/message_reply/{$m.id}&com=xshow|回复">回复</a>{/if}
                <a href='javascript:;' onclick="main.confirm_del('member/del_msg','{$m.id}')" class='iconfont icon-a' title='删除'>&#xe606;</a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {$page}

</div>